package com.lw.mall.service2.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lw.mall.entity.User;
import com.lw.mall.mapper.UserMapper;
import com.lw.mall.service2.UserService2;
import com.lw.mall.vo.SellerVo;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lw
 * @since 2022-09-25
 */
@Service("userServiceImpl2")
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService2 {

    @Override
    public SellerVo selectUserReputation(Integer sellId) {

        final User user = baseMapper.selectById(sellId);
        final SellerVo sellerVo = new SellerVo();
        BeanUtils.copyProperties(user,sellerVo);
        return sellerVo;
    }

    @Override
    public String getNameById(Long uid) {
        final User user = baseMapper.selectById(uid.intValue());
        return user.getUsername();
    }



}
